package com.etl.dataflow.scheduler.admin.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.etl.dataflow.scheduler.admin.validation.Add;
import com.etl.dataflow.scheduler.admin.validation.Update;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 任务组信息
 * </p>
 *
 * @author dx
 * @since 2022/6/20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("dataflow_task_group_info")
public class DataflowTaskGroupInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键,使用ID_WORKER策略,全局唯一ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(groups = Update.class)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;

    /**
     * 任务组名称
     */
    @NotBlank(groups = {Add.class, Update.class})
    @TableField("name")
    private String name;

    /**
     * 创建用户id
     */
    @TableField("creator_id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long creatorId;

    /**
     * 插入时间
     */
    @TableField(value = "idt", fill = FieldFill.INSERT)
    private LocalDateTime idt;

    /**
     * 更新时间
     */
    @TableField(value = "udt", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime udt;
}
